﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Shapes;

namespace WPFCouse
{
    /// <summary>
    /// ImageWindow.xaml 的交互逻辑
    /// </summary>
    public partial class ImageWindow : Window
    {
        public ImageWindow()
        {
            InitializeComponent();
        }

        private void Window_Loaded(object sender, RoutedEventArgs e)
        {
            //application 资源文件
          //   img.Source = new BitmapImage(new Uri("imgs/05.jpg",UriKind.Relative)); //设置图片源
          // pack URI
          //绝对路径
          //application授权
          //img.Source = new BitmapImage(new Uri("pack://application:,,,/imgs/05.jpg", UriKind.Absolute));
          //siteoforigin授权
          // img.Source = new BitmapImage(new Uri("pack://siteoforigin:,,,/imgs/05.jpg", UriKind.Absolute));

            //debug下的图片文件
            //img.Source = new BitmapImage(new Uri(AppDomain.CurrentDomain.BaseDirectory+"/imgs/05.jpg", UriKind.Absolute));
        }

        private void btnShowImage1_Click(object sender, RoutedEventArgs e)
        {   // 目前不好用- 原因未知
            //application 资源文件
            img.Source = new BitmapImage(new Uri("/Resources/Images/雪景图3.jpeg", UriKind.Relative)); //设置图片源
        }
    }
}
